<template>
  <div>
    <slot></slot>
  </div>
</template>
<script>
export default {
  name: "DescriptionForm",
  data() {
    return {
      dataModel: undefined
    };
  },
  props: {
    data: { type: Object, default: undefined },
    labelWidth: { type: String, default: undefined }
  },

  provide() {
    return {
      getData: () => {
        if (this.dataModel) return this.dataModel;
        else return this.data;
      },
      formLabelWidth: this.labelWidth
    };
  },
  watch: {
    data(newval, oldVal) {
      this.dataModel = newval;
      console.log(this.dataModel);
    }
  }
};
</script>
